//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System;
using System.Web;
using System.Xml.Serialization;

namespace CommunityServer.Components 
{

	[Serializable]
	public class SiteSettings 
	{
		

		private int settingsID = 1;
		private string defaultTimeFormat = "h:mm tt";
		private SearchMode defaultSearchMode = SearchMode.Simple;
		private bool defaultEnableEmail = false;
		private bool defaultEnableAutoPostDelete = false;
		private bool defaultEnableAutoUserDelete = false;
		private bool defaultEnableAnonymousUserTracking = true;
		private bool defaultEnableAnonymousUserPosting = false;
		private string defaultDateFormat = "d MMM yyyy";
		private string defaultSiteDescription = "The platform that enables you to build rich, interactive communities";
		bool _enableSiteDescription = true;
		private string defaultTheme = "default";
		private string defaultSiteName = "Community Server";
		private string defaultSmtpServer = "localhost";
		private int defaultTimezoneOffset = -8;
		private int defaultAnonymousCookieExpiration = 20;
		private string defaultAnonymousCookieName = "CSAnonymous";
		private string defaultCookieDomain = "localhost";
		private int defaultAnonymousUserOnlineTimeWindow = 30;
		private int defaultAvatarHeight = 80;
		private int defaultAvatarWidth = 80;
		private int defaultRoleCookieExpiration = 20;
		private string defaultRoleCookieName = "CSRoles";
		private bool defaultEnableAvatars = true;
		private bool defaultEnableDebugMode = false;
		private bool defaultEnableEmoticons = false;
		private bool defaultEnableRemoteAvatars = false;
		private bool defaultEnableRoleCookie = true;
		private bool defaultEnableVersionCheck = true;
		private ThreadDateFilterMode threadDateFilter = ThreadDateFilterMode.TwoMonths;
		private bool smtpServerUsingNtlm = false;
		private bool defaultSmtpServerRequiredLogin = false;
		private string defaultSmtpServerUserName ="";
		private string defaultSmtpServerPassword = "";
		private string defaultSmtpPortNumber = "";

		private bool enableDefaultRole = true;
		private Guid siteKey;
		private Guid secureKey = Guid.NewGuid();
		private bool defaultEnablePointSystem = false;
		private DisplayLevel defaultPointsPostDisplayLevel = DisplayLevel.None;
		private DisplayLevel defaultPointsUserDisplayLevel = DisplayLevel.None; 
		private int defaultPointsPostFactor = 5;
		private int defaultPointsReplyFactor = 15;
		private int defaultPointsReplierFactor = 0;
		private int defaultPointsRatingFactor = 6;
		private int defaultPointsDownloadFactor = 0;
		private int defaultPointsDownloaderFactor = 5;
		private int defaultPointsFavoriteUserFactor = 100;
		private int defaultPointsFavoritePostFactor = 0;
		private int defaultPointsRaterFactor = 1;
		private bool enableSecureSyndication = false;
		private bool enableInk = false;
        private bool enableRssSearch = false;
        private bool enableDisplayNames = false;
		private bool requireAuthenticationForProfiles = false;
		private bool enableEula = true;
		private bool enableSectionLocalization = false;
        private string termsOfServiceUrl = null;

		private string nntpServerLocation = "";

        public string TermsOfServiceUrl
        {
            get{return termsOfServiceUrl;}
            set{termsOfServiceUrl = value;}
        }

		public bool EnableEula
		{
			get { return enableEula; }
			set { enableEula = value; }
		}

		public bool EnableInk
		{
			get{return enableInk;}
			set{enableInk = value;}
		}

		public bool EnableSectionLocalization
		{
			get {return enableSectionLocalization;}
			set {enableSectionLocalization = value;}
		}

        public bool EnableDisplayNames
        {
            get{return enableDisplayNames;}
            set{enableDisplayNames = value;}
        }

		public bool RequireAuthenticationForProfiles
		{
			get { return requireAuthenticationForProfiles; }
			set { requireAuthenticationForProfiles = value; }
		}

		public string NntpServerLocation
		{
			get { return nntpServerLocation; }
			set { nntpServerLocation = value; }
		}

		#region Points
		public bool EnablePointSystem
		{
			get
			{
					return defaultEnablePointSystem;
			}
			set { defaultEnablePointSystem = value; }
		}

		public DisplayLevel PointsPostDisplayLevel
		{
			get
			{
					return defaultPointsPostDisplayLevel;
			}
			set { defaultPointsPostDisplayLevel = value; }
		}

		public DisplayLevel PointsUserDisplayLevel
		{
			get
			{
					return defaultPointsUserDisplayLevel;
			}
			set { defaultPointsUserDisplayLevel = value; }
		}

		public int PointsPostFactor
		{
			get
			{
					return defaultPointsPostFactor;
			}
			set
			{
				defaultPointsPostFactor = value;
			}
		}

		public int PointsReplyFactor
		{
			get
			{
					return defaultPointsReplyFactor;
			}
			set
			{
				defaultPointsReplyFactor = value;
			}
		}

		public int PointsReplierFactor
		{
			get
			{
					return defaultPointsReplierFactor;
			}
			set
			{
				defaultPointsReplierFactor = value;
			}
		}

		public int PointsRatingFactor
		{
			get
			{
					return defaultPointsRatingFactor;
			}
			set
			{
				defaultPointsRatingFactor= value;
			}
		}

		public int PointsDownloadFactor
		{
			get
			{
					return defaultPointsDownloadFactor;
			}
			set
			{
				defaultPointsDownloadFactor= value;
			}
		}

		public int PointsDownloaderFactor
		{
			get
			{
					return defaultPointsDownloaderFactor;
			}
			set
			{
				defaultPointsDownloaderFactor= value;
			}
		}

		public int PointsFavoritePostFactor
		{
			get
			{
					return defaultPointsFavoritePostFactor;
			}
			set
			{
				defaultPointsFavoritePostFactor = value;
			}
		}

		public int PointsFavoriteUserFactor
		{
			get
			{
					return defaultPointsFavoriteUserFactor;
			}
			set
			{
				defaultPointsFavoriteUserFactor = value;
			}
		}

		public int PointsRaterFactor
		{
			get
			{
					return defaultPointsRaterFactor;
			}
			set
			{
				defaultPointsRaterFactor = value;
			}
		}
		#endregion
        
        #region EnableDefaultRole
        /// <summary>
        /// Should users be given a default role as they are added to the system
        /// </summary>
        public bool EnableDefaultRole
        {
            get
            {  return this.enableDefaultRole; }
            set
            {  this.enableDefaultRole = value; }
        }
        #endregion
        
        #region General Settings

        int _SiteSettingsCacheWindowInMinutes = 15;
        public int SiteSettingsCacheWindowInMinutes {
            get {
                
                    return _SiteSettingsCacheWindowInMinutes;
            }
            set {
                _SiteSettingsCacheWindowInMinutes = value;
            }
        }


        

        string _SearchMetaDescription = string.Empty;
		public string SearchMetaDescription {
			get {
				
					return _SearchMetaDescription;
			}
			set {
				_SearchMetaDescription = value;
			}
		}

        string _SearchMetaKeywords = string.Empty;
		public string SearchMetaKeywords {
			get {
				
					return _SearchMetaKeywords;
			}
			set {
				_SearchMetaKeywords = value;
			}
		}
		
        string _Copyright = string.Empty;
		public string Copyright {
			get {
				
					return _Copyright;
			}
			set {
				_Copyright = value;
			}
		}

		string _SiteUrl = string.Empty;
		public string SiteUrl
		{
			get {
			    //we cant access the CSContext here because this is used in the creation of a Context
                //if (_SiteUrl == string.Empty && CSContext.Current.IsWebRequest)
                if (_SiteUrl == string.Empty && HttpContext.Current != null)
                {
					_SiteUrl = Globals.HostPath(HttpContext.Current.Request.Url) + Globals.ApplicationPath;
					SiteSettingsManager.Save(this);
				}
				return _SiteUrl;
			}
			set {
				_SiteUrl = value;
			}
		}

        #endregion

        #region Contact Details
        string _AdminEmailAddress = string.Empty;
        public string AdminEmailAddress 
		{
            get {
                
                    return _AdminEmailAddress;
            }
            set {
                _AdminEmailAddress = value;
            }
        }

        string _CompanyName = string.Empty;
        public string CompanyName {
            get {
                    return _CompanyName;

            }
            set {
                _CompanyName = value;
            }
        }

        string _CompanyContactUs = string.Empty;
        public string CompanyContactUs {
            get {
                
                    return _CompanyContactUs;

            }
            set {
                _CompanyContactUs = value;
            }
        }

        string _CompanyFaxNumber = string.Empty;
        public string CompanyFaxNumber {
            get {
                
                    return _CompanyFaxNumber;

            }
            set {
                _CompanyFaxNumber = value;
            }
        }

        string _CompanyAddress = string.Empty;
        public string CompanyAddress {
            get {
                
                    return _CompanyAddress;

            }
            set {
                _CompanyAddress = value;
            }
        }
        #endregion

        #region RSS

        int _RssCacheWindowInSeconds = 90;
        public int RssCacheWindowInSeconds {
            get {
                
                    return _RssCacheWindowInSeconds;
            }
            set {
                _RssCacheWindowInSeconds = value;
            }
        }


        public bool EnableSecureSyndication
        {
            get{ return enableSecureSyndication;}
            set { enableSecureSyndication = value;}
        }

        public bool EnableRssSearch
        {
            get{ return enableRssSearch;}
            set{enableRssSearch = value;}
        }

        #endregion

        #region Menus and Sections
        bool _EnablePublicMemberList = true;
        public bool EnablePublicMemberList {
            get {
               return _EnablePublicMemberList;
            }
            set {
                _EnablePublicMemberList = value;
            }
        }

        bool _EnableBirthdays = false;
        public bool EnableBirthdays {
            get {
                return _EnableBirthdays;
            }
            set {
                _EnableBirthdays = value;
            }
        }

        bool _EnableCurrentTime = true;
        public bool EnableCurrentTime {
            get {
                
                    return _EnableCurrentTime;
            }
            set {
                _EnableCurrentTime = value;
            }
        }

        bool _EnableSiteStatistics = true;
        public bool EnableSiteStatistics {
            get {
                    return _EnableSiteStatistics;
            }
            set {
                _EnableSiteStatistics= value;
            }
        }

        bool _EnableWhoIsOnline = true;
        public bool EnableWhoIsOnline {
            get {
               
                    return _EnableWhoIsOnline;
            }
            set {
                _EnableWhoIsOnline = value;
            }
        }
        #endregion

        #region User Registration
        public bool EnableUsernameChange {
            get {
				return false;
            }
            set {

            }
        }

//        MembershipPasswordFormat _MembershipPasswordFormat = MembershipPasswordFormat.Hashed;
//        public MembershipPasswordFormat PasswordFormat {
//            get {
//                
//                    return _MembershipPasswordFormat;
//            }
//            set {
//                _MembershipPasswordFormat = value;
//            }
//        }

        private AccountActivation _AccountActivation = AccountActivation.Automatic;
        public AccountActivation AccountActivation {
            get {
               
                    return _AccountActivation;
            }
            set {
                _AccountActivation = value;
            }
        }

        private PasswordRecovery _PasswordRecovery = PasswordRecovery.Reset;
        public PasswordRecovery PasswordRecovery {
            get {
               
                    return _PasswordRecovery;
            }
            set {
                _PasswordRecovery = value;
            }
        }

        bool _AllowUserSignatures = true;
        public bool AllowUserSignatures {
            get {
                return _AllowUserSignatures;
            }
            set {
               _AllowUserSignatures = value;
            }
        }

        bool _AllowNewUserRegistration = true;
        public bool AllowNewUserRegistration {
            get {
                return _AllowNewUserRegistration;
            }
            set {
                _AllowNewUserRegistration = value;
            }
        }

        ModerationLevel _ModerationLevel = ModerationLevel.Moderated;
        public ModerationLevel NewUserModerationLevel {
            get {
                
                    return _ModerationLevel;
            }
            set {
                _ModerationLevel = value;
            }
        }

        bool _AllowLogin = true;
        public bool AllowLogin {
            get {
              
                    return _AllowLogin;
            }
            set {
                _AllowLogin = value;
            }
        }

        bool _EnableUserSignatures = true;
        public bool EnableUserSignatures {
            get {
                return _EnableUserSignatures;
            }
            set {
                _EnableUserSignatures = value;
            }
        }

        int _UserSignatureMaxLength = 256;
        public int UserSignatureMaxLength {
            get {
                return _UserSignatureMaxLength;
            }
            set {
                _UserSignatureMaxLength = value;
            }
        }

        int _UsernameMaxLength = 64;
		public int UsernameMaxLength {
			get {
				
					return _UsernameMaxLength;
			}
			set {
				if ((value > 256) || (value < UsernameMinLength))
					_UsernameMaxLength = 64;
				else
					_UsernameMaxLength = value;
			}
		}

		
        int _UsernameMinLength = 3;
		public int UsernameMinLength {
			get {
				
					return _UsernameMinLength;
			}
			set {
				if ((value < 3) || (value > UsernameMaxLength))
					_UsernameMinLength = 3;
				else
					_UsernameMinLength = value;
			}
		}

        string _UsernameRegex = "[a-zA-Z]+[^\\<\\>]*";
		public string UsernameRegex {
			get {
				return _UsernameRegex;
			}
			set {
					_UsernameRegex = value;
			}
		}

        string _PasswordRegex = "(.*)";
		public string PasswordRegex {
			get {
					return _PasswordRegex;
			}
			set {
				_PasswordRegex = value;
			}
		}

        bool _AllowGender = false;
        public bool AllowGender {
            get {
               
                    return _AllowGender;
            }
            set {
                _AllowGender = value;
            }
        }

		bool _ShowContactCheckboxes = false;
		public bool ShowContactCheckboxes
		{
			get { return _ShowContactCheckboxes;  }
			set { _ShowContactCheckboxes = value;  }
		}
        #endregion

        #region MemberList
        int _MaxTopPostersToDisplay = 10;
        public int MaxTopPostersToDisplay {
            get {
               
                    return _MaxTopPostersToDisplay;
            }
            set {
                if ((value < 0) || (value > 100))
                    value = 10;

                _MaxTopPostersToDisplay = value;
            }
        }

        int _MembersPerPage = 20;
        public int MembersPerPage {
            get {
                return _MembersPerPage;
            }
            set {
                if ((value < 0) || (value > 100))
                    value = 20;

                _MembersPerPage = value;
            }
        }

        bool _EnablePublicAdvancedMemberSearch = true;
        public bool EnablePublicAdvancedMemberSearch {
            get {
                
                    return _EnablePublicAdvancedMemberSearch;
            }
            set {
                _EnablePublicAdvancedMemberSearch = value;
            }
        }


        #endregion

        #region IP Address Tracking

        bool _EnableTrackPostsByIP = true;
        public bool EnableTrackPostsByIP {
            get {
          
                    return _EnableTrackPostsByIP;
            }
            set {
                _EnableTrackPostsByIP = value;
            }
        }

        bool _DisplayPostIP = false;
        public bool DisplayPostIP {
            get {
                
                    return _DisplayPostIP;
            }
            set {
               _DisplayPostIP = value;
            }
        }
        
        bool _DisplayPostIPAdminsModeratorsOnly = true;
        public bool DisplayPostIPAdminsModeratorsOnly {
            get {

                    return _DisplayPostIPAdminsModeratorsOnly;
            }
            set {
                _DisplayPostIPAdminsModeratorsOnly = value;
            }
        }
        #endregion

        #region Properties

		int _SearchPostsPerPage = 10;
		public int SearchPostsPerPage 
		{
			get 
			{
				
				return _SearchPostsPerPage;
			}
			set 
			{
				_SearchPostsPerPage = value;
			}
		}


        [XmlIgnore]
        public int SettingsID {
            get {
                return settingsID;
            }
            set {
                settingsID = value;
            }
        }

        string siteDomain;
        [XmlIgnore]
        public string SiteDomain {
            get {
				if (siteDomain != null)
	                return siteDomain;
				else
					return SiteUrl;
            }
            set {
                siteDomain = value;
            }
        }

		string siteDomainUrl = null;
		/// <summary>
		/// returns the site domain in a format suitable for creating a uri
		/// </summary>
		public String SiteDomainUrl
		{
			get
			{
				if(siteDomainUrl == null)
				{
					if (!SiteDomain.ToLower().StartsWith("http") && !SiteDomain.ToLower().StartsWith("https"))
						siteDomainUrl = string.Concat("http://" + this.SiteDomain);
					else
						siteDomainUrl = this.SiteDomain;
				}

				return siteDomainUrl;
			}
		}

		string siteDomainHostUrl = null;
		/// <summary>
		/// returns the protocol and dns name of the current site domain in url format
		/// </summary>
		public string SiteDomainHostUrl
		{
			get
			{
				if(siteDomainHostUrl == null)
				{
					Uri SiteDomainUri = new Uri(this.SiteDomainUrl);
					siteDomainHostUrl = string.Concat(SiteDomainUri.Scheme, "://", SiteDomainUri.Host);
				}
				return siteDomainHostUrl;
			}
		}

        private string applicationName;
        /// <summary>
        /// Property ApplicationName (string)
        /// </summary>
        [XmlIgnore]
        public string ApplicationName
        {
            get {  return this.applicationName; }
            set {  this.applicationName = value; }
        }

        [XmlIgnore]
        public Guid PublicSiteKey
        {
            get{return siteKey;}
            set{siteKey = value;}
        }

        public Guid SecureKey
        {
            get{return secureKey;}
            set{secureKey = value;}
        }


        public bool EnableVersionCheck {
            get {
                    return defaultEnableVersionCheck;

            }
            set {
                defaultEnableVersionCheck = value;
            }
        }

        public bool EnableEmail {
            get {
      
                    return defaultEnableEmail;

            }
            set {
                defaultEnableEmail = value;
            }
        }

		private bool enableMailGateway = false;
		public bool EnableMailGateway
		{
			get
			{

				return enableMailGateway;

			}
			set
			{
				enableMailGateway = value;
			}
		}

        int _EmailThrottle = -1;
		public int EmailThrottle {
			get {
					return _EmailThrottle;
			}
			set {
				_EmailThrottle = value;
			}
		}

		private string defaultEmailEncoding = "utf-8";
		public string EmailEncoding
		{
			get { return defaultEmailEncoding; }
			set { defaultEmailEncoding = value; }
		}

        bool _EnableAntiSpamProtection = false;
        public bool EnableAntiSpamProtection {
          get {
         
              return _EnableAntiSpamProtection;
          }
          set {
           _EnableAntiSpamProtection = value;
          }
        }

        public ThreadDateFilterMode DefaultThreadDateFilter 
        {
            get {
                    return threadDateFilter;
            }
            set {
                threadDateFilter = value;
            }
        }


        public string DefaultTheme {
            get {
                    return defaultTheme;

            }
            set {
                defaultTheme = value;
            }
        }

        bool _EnableUserThemeSelection = true;
		public bool EnableUserThemeSelection {
			get {

					return _EnableUserThemeSelection;

			}
			set {
				_EnableUserThemeSelection = value;
			}
		}

        string _DomainName = null;
        public string DomainName {
            get {
                return _DomainName;
            }
            set {
                _DomainName = value;
            }
        }

        public string SiteName {
            get {
                    return defaultSiteName;
            }
            set {
                defaultSiteName = value;
            }
        }

		public bool EnableSiteDescription 
		{
			get 
			{
                
				return _enableSiteDescription;
			}
			set 
			{
				_enableSiteDescription = value;
			}
		}
		
		public string SiteDescription 
		{
            get {
  
                    return defaultSiteDescription;
            }
            set {
               defaultSiteDescription = value;
            }
        }

        private string _RawAdditionalHeader;
        public string RawAdditionalHeader 
        {
            get 
            {
  
                return _RawAdditionalHeader;
            }
            set 
            {
                _RawAdditionalHeader = value;
            }
        }

        public string DateFormat {
            get {
                    return defaultDateFormat;
            }
            set {
                defaultDateFormat = value;
            }
        }

        public string TimeFormat {
            get {
 
                    return defaultTimeFormat;
            }
            set {
                defaultTimeFormat = value;
            }
        }

        public string SmtpServer {
            get {

                    return defaultSmtpServer;
            }
            set {
                defaultSmtpServer = value;
            }
        }


        public int TimezoneOffset {
            get {
                    return defaultTimezoneOffset;
            }
            set {
                defaultTimezoneOffset = value;
            }
        }

        public SearchMode SearchMode {
            get {
                    return defaultSearchMode;
            }
            set {
                defaultSearchMode = value;
            }
        }

        public bool EnableAutoPostDelete {
            get {

                    return defaultEnableAutoPostDelete;
            }
            set {
                defaultEnableAutoPostDelete = value;
            }
        }

        public bool EnableAutoUserDelete {
            get {
                    return defaultEnableAutoUserDelete;
            }
            set {
               defaultEnableAutoUserDelete = value;
            }
        }
 
        public bool EnableAnonymousUserTracking {
            get {
                    return defaultEnableAnonymousUserTracking;
            }
            set {
                defaultEnableAnonymousUserTracking = value;
            }
        }


        public bool EnableAnonymousUserPosting {
            get {

                    return defaultEnableAnonymousUserPosting;
            }
            set {
               defaultEnableAnonymousUserPosting = value;
            }
        }

        public int AvatarHeight {
            get {

                    return defaultAvatarHeight;
            }
            set {
                defaultAvatarHeight = value;
            }
        }

        public int AvatarWidth {
            get {

                    return defaultAvatarWidth;
            }
            set {
               defaultAvatarWidth = value;
            }
        }

        public string RoleCookieName {
            get {

                    return defaultRoleCookieName;
            }
            set {
                defaultRoleCookieName = value;
            }
        }

        public int RoleCookieExpiration {
            get {

                    return defaultRoleCookieExpiration;
            }
            set {
                defaultRoleCookieExpiration = value;
            }
        }

        public string AnonymousCookieName {
            get {
                    return defaultAnonymousCookieName;
            }
            set {
                defaultAnonymousCookieName = value;
            }
        }


		public string CookieDomain    
		{ 
			get 
			{ 
 
					return defaultCookieDomain; 
			} 
			set 
			{ 
				defaultCookieDomain = value; 
			} 
		} 

        public int AnonymousCookieExpiration 
		{
            get {

                    return defaultAnonymousCookieExpiration;
            }
            set {
                defaultAnonymousCookieExpiration = value;
            }
        }

        public int AnonymousUserOnlineTimeWindow {
            get {
                    return defaultAnonymousUserOnlineTimeWindow;
            }
            set {
                defaultAnonymousUserOnlineTimeWindow = value;
            }
        }

        int _UserOnlineTimeWindow = 15;
		public int UserOnlineTimeWindow {
			get {
				
					return _UserOnlineTimeWindow;
			}
			set {
				_UserOnlineTimeWindow = value;
			}
		}

        public bool EnableEmoticons {
            get {

                    return defaultEnableEmoticons;
            }
            set {
                defaultEnableEmoticons = value;
            }
        }

        public bool EnableAvatars {
            get {

                    return defaultEnableAvatars;
            }
            set {
                defaultEnableAvatars = value;
            }
        }

        public bool EnableRemoteAvatars {
            get {
           
                    return defaultEnableRemoteAvatars;
            }
            set {
               defaultEnableRemoteAvatars = value;
            }
        }

        public bool EnableRoleCookie {
            get {
        
                    return defaultEnableRoleCookie;
            }
            set {
                defaultEnableRoleCookie = value;
            }
        }

        public bool EnableDebugMode {
            get {
                    return defaultEnableDebugMode;
            }
            set {
               defaultEnableDebugMode = value;
            }
        }

		public bool SmtpServerUsingNtlm
		{
			get { return smtpServerUsingNtlm; }
			set { smtpServerUsingNtlm = value; }
		}

		public string SmtpServerUserName {
			get {
					return defaultSmtpServerUserName;
			}
			set {
				defaultSmtpServerUserName = value;
			}
		}

		public string SmtpServerPassword {
			get {

					return defaultSmtpServerPassword;
			}
			set {
				defaultSmtpServerPassword = value;
			}
		}

		public bool SmtpServerRequiredLogin {
			get {

					return defaultSmtpServerRequiredLogin;
			}
			set {
				defaultSmtpServerRequiredLogin = value;
			}
		} 

		public string SmtpPortNumber 
		{
			get 
			{
					return defaultSmtpPortNumber;
			}
			set 
			{
				defaultSmtpPortNumber = value;
			}
		}

        bool _EnableCensorship = true;
		public bool EnableCensorship {
			get{
				
					return _EnableCensorship;
			}
			set { _EnableCensorship = value;	}
		}

		private SectionRatingType defaultSectionRatingType = SectionRatingType.ThreadRating;
		public SectionRatingType SectionRatingType
		{
			get
			{
				return defaultSectionRatingType;
			}
			set 
			{
				defaultSectionRatingType = value;
			}
		}

		#endregion

		#region Enable user ranking

		private UserActivityDisplayMode postingActivityDisplay = UserActivityDisplayMode.PostCount;
		public UserActivityDisplayMode PostingActivityDisplay 
		{
			get 
			{
           
				return postingActivityDisplay;

			}
			set 
			{
				postingActivityDisplay = value;
			}
		}

		bool _DisplayUserRankAsPicture = false;
		public bool DisplayUserRankAsPicture 
		{
			get
			{
				
				return _DisplayUserRankAsPicture;
			}
			set { _DisplayUserRankAsPicture = value;	}
		}
		#endregion



        #region Enable banned users to login
        bool _EnableBannedUsersToLogin =false;
		public bool EnableBannedUsersToLogin {
			get{

					return _EnableBannedUsersToLogin;
			}
			set { _EnableBannedUsersToLogin = value;	}
		}
        #endregion

        #region Enable User Moderation Counters

        bool _EnableUserModerationCounters = false;
		public bool EnableUserModerationCounters {
			get{

					return _EnableUserModerationCounters;
			}
			set {_EnableUserModerationCounters = value;	}
		}
        #endregion

    }

}
